package com.stox.services.watchlist.manager.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.stox.services.watchlist.manager.WatchlistEntryManager;
import com.stox.services.watchlist.repository.WatchlistEntryRepository;
import com.stox.shared.model.WatchlistEntry;

@Component
public class WatchlistEntryManagerImpl implements WatchlistEntryManager {

	@Autowired
	private WatchlistEntryRepository watchlistEntryRepository;
	
	@Override
	public List<WatchlistEntry> findByWatchlistId(Long watchlistId) {
		return watchlistEntryRepository.findByWatchlistId(watchlistId);
	}

	@Override
	public Long saveOrUpdate(WatchlistEntry watchlistEntry) {
		return watchlistEntryRepository.saveOrUpdate(watchlistEntry);
	}

	@Override
	public void delete(Long id) {
		watchlistEntryRepository.delete(id);
	}

}
